
		<section class="page" id="pQa">
			<div class="ct_content">
				<h2><?php echo h($rowCategory['title']); ?></h2>	
				<div class="search">
					<p>Đặt câu hỏi khác</p>
					<div class="ct_search">

<form name="frmQuestion" id="frmQuestion" action="<?php echo $link_add_url; ?>" method="POST">
					
						<input type="hidden" id="cat_id" name="cat_id" value="<?php echo $cat_id; ?>">
						<input type="hidden" id="member_id" name="member_id" value="<?php echo $current_member_id; ?>">
						<input class="ip_t" type="text" id="question" name="question">
						<input class="ip_s" type="submit" value="Gửi câu hỏi">
</form>						
						
						
					</div>
				</div>
				<div class="ct_list antiscroll-wrap">
					<div class="antiscroll-inner">
						<div class="box-inner">
						
						<?php
						foreach ($rsQuestion as $rowQuestion) :
						
							$objComment = new Amway_Comment();
							$rsComment = $objComment->getAllCommentOfQuestion($rowQuestion['id']);
							
						?>
						
							<div class="list">
								<h4><?php echo h($rowQuestion['question']); ?></h4>
								<div class="list_sh">
									<div class="list_content">
										<p><?php echo h($rowQuestion['answer']); ?></p>
									</div>
									<div class="comment">
										<a class="load_cm" href="#">Xem thêm câu trả lời</a>
										<div class="list_cm">
											<ul>
											
											<?php foreach ($rsComment as $rowComment) : ?>
												<li>
													<div class="ct_img">
														<a href="#"><img src="http://graph.facebook.com/<?php echo $rowComment['fbid']; ?>/picture"></a>
													</div>
													<div class="copy">
														<a class="tt" href="#"><?php echo h($rowComment['fullname']);?></a>
														<p><?php echo h($rowComment['content']); ?></p>
													</div>
												</li>
											<?php endforeach; ?>
												
<form name="frmComment" id="frmComment" action="<?php echo $link_add_comment_url; ?>" method="POST">												
												<li>
													<div class="ct_img">
														<a href="#"><img src="<?php echo __ASSET_URL; ?>amway/images/demo/ava.jpg"></a>
													</div>
													
													<input type="hidden" id="cat_id" name="cat_id" value="<?php echo $cat_id; ?>">
													<input type="hidden" id="question_id" name="question_id" value="<?php echo $rowQuestion['id']; ?>">
													<input type="hidden" id="member_id" name="member_id" value="<?php echo $current_member_id; ?>">
													
													<textarea id="content" name="content"></textarea>
												</li>
</form>												
												
											</ul>
										</div>
									</div>
								</div>
							</div>
							
							<?php
							  
							endforeach;
							
							?>
						
						</div>
					</div>
					
				</div>
			</div>	
		</section>
		
<script type="text/javascript">

function ctrlEnter(event, onlyEnter) 
{
    if (isUndefined(onlyEnter)) onlyEnter = 0;
    if ((event.ctrlKey || onlyEnter) && event.keyCode == 13) 
    {
    	$('#frmComment').submit();
        return false;
    }
    return true;
}

function isUndefined(variable) 
{
    return typeof variable == 'undefined' ? true : false;
}

$(document).ready(function() {
    console.log( "ready!" );
    $('#content').keypress(function(evt)
    		{
    			ctrlEnter(evt, true);
    		});	
    
});


</script>							
